"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
const fs = __importStar(require("fs"));
const path_1 = __importDefault(require("path"));
const vue = __importStar(require("vue"));
const vue_1 = require("vue");
const core_1 = __importDefault(require("@logicflow/core"));
const global_1 = require("../../config/global");
const node_panel_1 = __importDefault(require("../components/LFCompoents/node_panel/node_panel"));
const add_panel_1 = __importDefault(require("../components/LFCompoents/add_panel/add_panel"));
const control_panel_1 = __importDefault(require("../components/LFCompoents/control_panel/control_panel"));
const property_dialog_1 = __importDefault(require("../components/PropertySetting/PropertyCompoents/property_dialog/property_dialog"));
const data_dialog_1 = __importDefault(require("../components/LFCompoents/data_dialog/data_dialog"));
const nav_menu_1 = __importDefault(require("../components/LFCompoents/nav_menu/nav_menu"));
const plot_list_1 = __importDefault(require("../components/LFCompoents/plot-list/plot-list"));
const role_header_1 = __importDefault(require("../components/LFCompoents/change_panel/role_header/role_header"));
const location_header_1 = __importDefault(require("../components/LFCompoents/change_panel/location_header/location_header"));
const config_1 = require("../components/config");
const tree_list_1 = require("../components/tree_list");
const element_plus_1 = require("element-plus");
const role_dialog_1 = __importDefault(require("../components/PropertySetting/PropertyCompoents/role_dialog/role_dialog"));
const conv_role_dialog_1 = __importDefault(require("../components/PropertySetting/PropertyCompoents/conv_role_dialog/conv_role_dialog"));
const location_dialog_1 = __importDefault(require("../components/PropertySetting/PropertyCompoents/location_dialog/location_dialog"));
const registerNode_1 = require("../components/registerNode");
const lib_css_1 = __importDefault(require("../../../../@libs/nodejs-lib-main/lib_css"));
const config_2 = __importDefault(require("../../../config"));
const role_describe_1 = __importDefault(require("../components/LFCompoents/change_panel/role_describe/role_describe"));
const location_describe_1 = __importDefault(require("../components/LFCompoents/change_panel/location_describe/location_describe"));
const project_describe_1 = __importDefault(require("../components/LFCompoents/change_panel/project_describe/project_describe"));
const role_show_1 = __importDefault(require("../components/LFCompoents/change_panel/role_show/role_show"));
const location_show_1 = __importDefault(require("../components/LFCompoents/change_panel/location_show/location_show"));
const reward_show_1 = __importDefault(require("../components/LFCompoents/change_panel/reward_show/reward_show"));
const playdemo_1 = __importDefault(require("../components/OtherCompoents/playdemo/playdemo"));
const registerCustomEdge_1 = __importDefault(require("../components/registerNode/registerCustomEdge"));
const demoData = require('../../../data/data.json');
const temp_treeData = tree_list_1.treeList;
const component = {
    template: fs.readFileSync(`${__dirname}/lf.html`, "utf-8"),
    name: 'lf',
    components: { ConvRoleDialog: conv_role_dialog_1.default, PlayDemo: playdemo_1.default, RewardShow: reward_show_1.default, ProjectDescribe: project_describe_1.default, RoleDialog: role_dialog_1.default, LocDialog: location_dialog_1.default, LocationDescribe: location_describe_1.default, LocationHeader: location_header_1.default, LocationShow: location_show_1.default, RoleShow: role_show_1.default, RoleHeader: role_header_1.default, RoleDescribe: role_describe_1.default, ElCollapseTransition: element_plus_1.ElCollapseTransition, NodePanel: node_panel_1.default, AddPanel: add_panel_1.default, PropertyDialog: property_dialog_1.default, DataDialog: data_dialog_1.default, NavMenu: nav_menu_1.default, PlotList: plot_list_1.default, ControlPanel: control_panel_1.default },
    setup() {
        const app = vue.createApp({});
        // 创建全局属性
        const myData = (0, vue_1.ref)('allReward');
        // 在应用实例中存储全局属性
        app.config.globalProperties.$myData = myData;
    },
    data() {
        return {
            loc_visible: (0, vue_1.ref)(false),
            role_visible: (0, vue_1.ref)(false),
            conv_role_visible: (0, vue_1.ref)(false),
            roleBoxPos: (0, vue_1.ref)(false),
            convIndex: -1,
            currentRole: (0, vue_1.ref)(''),
            currentLocation: null,
            selectElement: [],
            treeElement: [],
            allProject: {
                project_name: '未命名的项目',
                project_id: '',
                project_picUrl: '',
                project_others: '',
                project_desc: '',
            },
            allReward: [
                {
                    reward_name: '实给经验',
                    reward_id: 'experience',
                    reward_desc: '玩家获取的经验值',
                    reward_value: 0,
                },
                {
                    reward_name: '名声',
                    reward_id: 'reputation',
                    reward_desc: '玩家的名声',
                    reward_value: 0,
                }
            ],
            allRole: [],
            allLocation: [],
            changePanelIndex: 0,
            isOpenPlayDemo: (0, vue_1.ref)(false),
            show: (0, vue_1.ref)(true),
            selectIndex: 0,
            sceneList: [
                { scene: 0, label: "第 1 幕" },
            ],
            treeData: (0, vue_1.ref)(null),
            playDemo_treeData: null,
            lf: null,
            userData: {
                allReward: '',
                allRole: '',
                allLocation: '',
                graphData: ''
            },
            showAddPanel: false,
            addPanelStyle: {
                top: 0,
                left: 0
            },
            nodeData: null,
            addClickNode: null,
            clickNode: null,
            clickType: (0, vue_1.computed)(() => {
                const currentType = '设置节点属性';
                if (this.clickNode) {
                    return `设置节点属性-${this.clickNode.properties.graphRes_type}`;
                }
                else {
                    return currentType;
                }
            }),
            dialogVisible: false,
            graphData: null,
            dataVisible: false,
            config: {
                background: {
                    backgroundColor: '#f7f9ff',
                },
                grid: {
                    size: 20,
                    visible: true
                },
                keyboard: {
                    enabled: true,
                    shortcuts: [
                        {
                            keys: ["delete"],
                            callback: () => {
                                const elements = this.lf.getSelectElements(true);
                                this.lf.clearSelectElements();
                                elements.edges.forEach((edge) => this.lf.deleteEdge(edge.id));
                                elements.nodes.forEach((node) => this.lf.deleteNode(node.id));
                            },
                        },
                        {
                            keys: ["backspace"],
                            callback: () => {
                            },
                        },
                    ],
                },
                edgeTextDraggable: true,
                hoverOutline: false,
            },
            moveData: {},
            allGraphData: [],
            nodeList: config_1.nodeList,
            fileURl: ""
        };
    },
    computed: {},
    watch: {
        selectIndex: function (newValue, oldValue) {
            //数据变化时
            const old_data = JSON.stringify(this.lf.getGraphData());
            this.$data.allGraphData[oldValue] = old_data;
            let changeData = "";
            if (this.$data.allGraphData[newValue] == null) {
                const newGraph = {};
                this.$data.allGraphData.push(newGraph);
            }
            else {
                changeData = JSON.parse(this.$data.allGraphData[newValue]);
            }
            this.lf.render(changeData);
            this.$_LfEvent();
            this.$_updateNavMenu();
        },
        allRole: function (newValue, oldValue) {
            this.updateRoleList();
        },
        allLocation: function (newValue, oldValue) {
            this.updateLocationList();
        },
    },
    created() { },
    mounted() {
        // 加载 css
        lib_css_1.default.load([
            {
                parent: this.$el,
                url_s: path_1.default.join(config_2.default.root_path_s, "node_modules/@logicflow/extension/lib", "style", "index.css"),
            },
        ]);
        lib_css_1.default.load([
            {
                parent: this.$el,
                url_s: path_1.default.join(`${__dirname}/lf.css`),
            },
        ]);
        lib_css_1.default.load([
            {
                parent: this.$el,
                url_s: path_1.default.join(config_2.default.root_path_s, "node_modules/@logicflow/core/dist", "style", "index.css"),
            },
        ]);
        this.$_initLf();
    },
    methods: {
        $_initLf() {
            this.$data.treeData = temp_treeData;
            this.$data.fileURl = '../../../data/data.json';
            // 画布配置
            const lf = new core_1.default(Object.assign(Object.assign({}, this.config), { width: 1700, height: 950, edgeType: 'bezier', 
                // plugins: [
                //     Menu,
                // ],
                container: this.$refs.container }));
            this.lf = lf;
            // 设置主题
            lf.setTheme({
                circle: {
                    stroke: '#000000',
                    strokeWidth: 1,
                    outlineColor: '#88f',
                },
                rect: {
                    outlineColor: '#88f',
                    strokeWidth: 1
                },
                polygon: {
                    strokeWidth: 1
                },
                polyline: {
                    stroke: '#000000',
                    hoverStroke: '#000000',
                    selectedStroke: '#000000',
                    outlineColor: '#88f',
                    strokeWidth: 1
                },
                nodeText: {
                    color: '#000000'
                },
                edgeText: {
                    color: '#000000',
                    background: {
                        fill: '#f7f9ff'
                    }
                },
                outline: {
                    fill: "transparent",
                    stroke: "#ffa502",
                    strokeDasharray: "5",
                    hover: {
                        stroke: "#ffa502",
                    },
                },
                anchor: {
                    stroke: "#000000",
                    fill: "#FFFFFF",
                    r: 13,
                    hover: {
                        fill: "#949494",
                        fillOpacity: 0.5,
                        stroke: "#949494",
                        r: 25,
                    },
                },
                bezier: {
                    fill: "none",
                    stroke: "#000000",
                    strokeWidth: 2,
                    adjustLine: {
                        stroke: "#949494",
                    },
                    adjustAnchor: {
                        r: 4,
                        fill: "#949494",
                        stroke: "#949494",
                        fillOpacity: 1,
                    },
                },
            });
            this.$_registerNode();
            this.$_updateNavMenu();
        },
        // 自定义
        $_registerNode() {
            (0, registerNode_1.registerConnect)(this.lf);
            (0, registerNode_1.registerDialogueNode)(this.lf);
            (0, registerNode_1.registerChoiceNode)(this.lf);
            (0, registerNode_1.registerEndNode)(this.lf);
            (0, registerNode_1.registerFightNode)(this.lf);
            (0, registerNode_1.registerRewardNode)(this.lf, this.$data.allReward);
            (0, registerNode_1.registerConvFlowNode)(this.lf);
            (0, registerNode_1.registerStartNode)(this.lf);
            this.lf.register(registerCustomEdge_1.default);
            this.lf.setDefaultEdgeType("sql-edge");
            this.$_render();
        },
        $_render() {
            this.lf.render(demoData);
            this.$_LfEvent();
        },
        $_deleteScene(index) {
            this.$data.sceneList = this.$data.sceneList.filter((item, i) => i != index);
            this.$data.sceneIndex = this.$data.sceneList.length - 1;
            this.$_updateNavMenu();
        },
        $_addScene() {
            // 处理添加场景的逻辑
            const newScene = {
                scene: this.$data.sceneList.length, label: '第 ' + (this.$data.sceneList.length + 1) + ' 幕'
            };
            this.$data.sceneList.push(newScene);
            this.$data.sceneIndex = (this.$data.sceneList.length - 1);
            this.$_updateNavMenu();
        },
        //更新导航菜单
        $_updateNavMenu() {
            this.$data.treeData = temp_treeData;
            //项目
            this.updateProject();
            //剧情列表
            this.updatePlotList();
            //Logical图表数据
            this.updateLfGraph();
            //更新角色库
            this.updateRoleList();
            //更新角色库
            this.updateLocationList();
        },
        updateProject() {
            this.$data.treeData[0].label = this.$data.allProject.project_name;
        },
        updateRoleList() {
            // 找到父节点 "全局变量"
            const parentNode = this.$data.treeData[0].children[3];
            parentNode.children = [];
            for (let index = 0; index < this.$data.allRole.length; index++) {
                // 新的子节点数据
                const roleInfo = this.$data.allRole[index];
                const newChildNode = {
                    label: roleInfo.role_name,
                    type: roleInfo.PlotCraftRes_Type,
                    info: roleInfo
                };
                // 将新的子节点添加到父节点下
                parentNode.children.push(newChildNode);
            }
        },
        updateLocationList() {
            // 找到父节点 "全局变量"
            const parentNode = this.$data.treeData[0].children[4];
            parentNode.children = [];
            for (let index = 0; index < this.$data.allLocation.length; index++) {
                // 新的子节点数据
                const locationInfo = this.$data.allLocation[index];
                const newChildNode = {
                    label: locationInfo.location_name,
                    type: locationInfo.PlotCraftRes_Type,
                    info: locationInfo
                };
                // 将新的子节点添加到父节点下
                parentNode.children.push(newChildNode);
            }
        },
        updatePlotList() {
            // 找到父节点 "全局变量"
            const parentNode = this.$data.treeData[0].children[0];
            parentNode.children = [];
            for (let index = 0; index < this.$data.sceneList.length; index++) {
                // 新的子节点数据
                const newChildNode = {
                    label: this.$data.sceneList[index].label,
                };
                // 将新的子节点添加到父节点下
                parentNode.children.push(newChildNode);
            }
        },
        updateLfGraph() {
            const currentLfGraph = this.$_getData();
            currentLfGraph.nodes.forEach(item => {
                this.createObject(item);
            });
        },
        createObject(item) {
            console.log("item测试", item);
            const newNode = {
                label: item.properties.graphRes_title,
                type: item.properties.graphRes_type,
                id: item.id
            };
            const selectNode = new Map([
                ["开始", 0],
                ["对话", 1],
                ["对话流", 2],
                ["选择", 3],
                ["战斗", 4],
                ["奖励", 5],
                ["结束", 6],
            ]);
            const index = selectNode.get(newNode.type);
            this.$data.treeData[0].children[1].children[index].children.push(newNode);
        },
        $_getData() {
            const data = this.lf.getGraphData();
            return data;
        },
        $_LfEvent() {
            this.lf.on('node:click', ({ data }) => {
                console.log('node:click', data);
                this.$data.clickNode = data;
            });
            this.lf.on('node:contextmenu', ({ data }) => {
                console.log('node:contextmenu', data);
                this.$data.clickNode = data;
                this.$data.dialogVisible = true;
            });
            this.lf.on('node:dnd-add', ({ data }) => {
                console.log('node:dnd-drag添加节点', data);
                this.$data.clickNode = data;
                this.createObject(data);
            });
            this.lf.on('edge:click', ({ data }) => {
                console.log('edge:click', data);
                // this.$data.clickNode = data
                // this.$data.dialogVisible = true
            });
            this.lf.on('element:click', () => {
                this.hideAddPanel();
            });
            this.lf.on('anchor:dragend', ({ data, e, nodeModel, edgeModel }) => {
                if (nodeModel.type === 'choiceNode' && edgeModel) {
                    nodeModel.properties.choiceList[data.id].choice_target_id = edgeModel.targetNode.properties.graphRes_id;
                }
                if (nodeModel.type === 'fightNode' && edgeModel) {
                    if (data.id == 'win') {
                        nodeModel.properties.winSkipID = edgeModel.targetNode.properties.graphRes_id;
                    }
                    else if (data.id == 'fail') {
                        nodeModel.properties.failSkipID = edgeModel.targetNode.properties.graphRes_id;
                    }
                }
                this.lf.getNodeModelById(nodeModel.id).addField();
            });
            this.lf.on('edge:add', ({ data }) => {
            });
            this.lf.on('node:mousemove', ({ data }) => {
                this.moveData = data;
            });
            this.lf.on('blank:click', () => {
                this.hideAddPanel();
            });
            this.lf.on('connection:not-allowed', (data) => {
                this.$message({
                    type: 'error',
                    message: data.msg
                });
            });
            this.lf.on('node:mousemove', () => {
            });
            this.lf.on('openLoc', (nodeData) => {
                this.$data.clickNode = nodeData;
                this.$data.loc_visible = true;
            });
            this.lf.on('openRole', (event) => {
                this.$data.roleBoxPos = event.boxPos;
                this.$data.clickNode = event.nodeData;
                this.$data.role_visible = true;
            });
            this.lf.on('openConvFlowRole', (event) => {
                this.$data.convIndex = event.index;
                this.$data.clickNode = event.nodeData;
                this.$data.conv_role_visible = true;
            });
        },
        clickPlus(e, attributes) {
            e.stopPropagation();
            const { clientX, clientY } = e;
            this.$data.addPanelStyle.top = (clientY - 40) + 'px';
            this.$data.addPanelStyle.left = clientX + 'px';
            this.$data.showAddPanel = true;
            this.$data.addClickNode = attributes;
        },
        mouseDownPlus(e, attributes) {
            e.stopPropagation();
        },
        hideAddPanel() {
            this.$data.showAddPanel = false;
            this.$data.addPanelStyle.top = 0;
            this.$data.addPanelStyle.left = 0;
            this.$data.addClickNode = null;
        },
        closeDialog() {
            this.$data.dialogVisible = false;
        },
        $_catData() {
            this.$data.graphData = this.$data.lf.getGraphData();
            this.$data.dataVisible = true;
        },
        //下载数据
        $_downloadData() {
            this.$data.graphData = this.$_getData();
            const graphDataString = JSON.stringify(this.$data.graphData);
            fs.writeFile(this.$data.fileURl, graphDataString, (err) => {
                if (err) {
                    console.error(err);
                }
                else {
                    console.log('数据写入成功！');
                }
                this.$_LfEvent();
            });
        },
        //上传数据
        $_uploadData(url) {
            this.$data.fileURl = url;
            fs.readFile(url, 'utf8', (err, data) => {
                if (err) {
                    console.error(err);
                }
                else {
                    let graphDataString = JSON.parse(data);
                    this.lf.render(demoData);
                    this.$_LfEvent();
                }
            });
        },
        //切换视图
        updateSelectIndex(newValue) {
            this.selectIndex = newValue;
        },
        //改变面板
        $_changePanel(index) {
            if (index) {
                this.$data.changePanelIndex = index;
            }
            else {
                this.$data.changePanelIndex = 0;
            }
            this.$data.show = false;
        },
        //改变演示面板
        $_changePlayDemoPanel(id) {
            this.$data.treeElement = this.lf.getNodeModelById(id);
        },
        //删除角色
        $_deleteRole(idToDelete) {
            const newRoleList = this.$data.allRole.filter(role => role.PlotCraftRes_Id !== idToDelete);
            this.$data.allRole = newRoleList;
            this.updateRoleList();
        },
        //删除地点
        $_deleteLocation(idToDelete) {
            const newLocationList = this.$data.allLocation.filter(location => location.PlotCraftRes_Id !== idToDelete);
            this.$data.allLocation = newLocationList;
            this.updateLocationList();
        },
        //修改角色信息
        $_saveRoleInfo(updatedLocationData) {
            // 在角色列表中查找要更新的角色
            const updatedIndex = this.$data.allRole.findIndex(role => role.PlotCraftRes_Id === updatedLocationData.PlotCraftRes_Id);
            if (updatedIndex !== -1) {
                // 更新角色信息
                this.$data.allRole[updatedIndex] = updatedLocationData;
                console.log("Updated role", updatedLocationData);
            }
            else {
                console.error("Role not found for update");
            }
            this.updateRoleList();
            this.$data.changePanelIndex = 1;
        },
        //修改地点信息
        $_saveLocationInfo(updatedLocationData) {
            // 在角色列表中查找要更新的角色
            const updatedIndex = this.$data.allLocation.findIndex(location => location.PlotCraftRes_Id === updatedLocationData.PlotCraftRes_Id);
            if (updatedIndex !== -1) {
                // 更新角色信息
                this.$data.allLocation[updatedIndex] = updatedLocationData;
            }
            else {
                console.error("allLocation not found for update");
            }
            this.$data.changePanelIndex = 3;
            this.updateLocationList();
        },
        //修改项目信息
        $_saveProjectInfo(updatedProjectData) {
            this.$data.allProject = updatedProjectData;
            this.$data.changePanelIndex = 1;
            this.updateProject();
        },
        //保存奖励信息
        $_saveRewardInfo(updatedRewardData) {
            this.$data.allReward = updatedRewardData;
            (0, registerNode_1.registerRewardNode)(this.lf, this.$data.allReward);
        },
        //创建角色
        $_createRole() {
            const newRole = new global_1.role("未命名角色", "", "", "", "");
            this.$data.allRole.push(newRole);
            this.updateRoleList();
        },
        //创建角色
        $_createLocation() {
            const newLocation = new global_1.location("未命名地点", "", "", "", "");
            this.$data.allLocation.push(newLocation);
            this.updateLocationList();
        },
        //编辑角色
        $_editRole(edit_role) {
            this.$data.changePanelIndex = 2;
            this.$data.currentRole = edit_role;
        },
        //编辑地点
        $_editLocation(edit_location) {
            this.$data.changePanelIndex = 4;
            this.$data.currentLocation = edit_location;
        },
        //播放演示
        $_playDemo(allSelect) {
            this.$data.isOpenPlayDemo = true;
            this.$data.selectElement = allSelect[0];
            this.$_finishTreeList();
        },
        //整理tree-list
        $_finishTreeList() {
            const selectTreeList = [{
                    label: this.$data.allProject.project_name,
                    type: "project",
                    children: []
                }];
            const elementOrign = this.$data.selectElement;
            const finalList = this.$_getAllNode(selectTreeList, elementOrign);
            this.$data.playDemo_treeData = finalList;
        },
        //获取所有节点
        $_getAllNode(treeList, elementOrign) {
            const treeNode = {
                label: elementOrign.properties.graphRes_title,
                type: elementOrign.properties.graphRes_type,
                id: elementOrign.id
            };
            treeList[0].children.push(treeNode);
            const nextNode = this.lf.getNodeOutgoingNode(elementOrign.id);
            if (nextNode && nextNode[0]) {
                this.$_getAllNode(treeList, nextNode[0]);
            }
            return treeList;
        },
        //关闭演示
        $_closeDemoPanel() {
            this.$data.isOpenPlayDemo = false;
        },
        sureLocPic(selectLocation) {
            const updateInfo = this.$data.clickNode.properties;
            updateInfo.locationPic = selectLocation.location_picUrl;
            updateInfo.locationName = selectLocation.location_name;
            updateInfo.locationID = selectLocation.location_id;
            this.lf.setProperties(this.$data.clickNode.id, Object.assign({}, updateInfo));
            this.$data.loc_visible = false;
        },
        //待修改
        sureRolePic(selectRole) {
            const updateInfo = this.$data.clickNode.properties;
            updateInfo.rolePic = selectRole.role_picUrl;
            updateInfo.roleName = selectRole.role_name;
            updateInfo.roleID = selectRole.role_id;
            updateInfo.rolePos = this.$data.roleBoxPos;
            this.lf.setProperties(this.$data.clickNode.id, Object.assign({}, updateInfo));
            this.$data.role_visible = false;
        },
        sureConvRolePic(selectRole) {
            const updateInfo = this.$data.clickNode.properties;
            const index = this.$data.convIndex;
            console.log("selectRole选择", selectRole);
            updateInfo.currentConvFlow.role_pic = selectRole.role_picUrl;
            updateInfo.currentConvFlow.role_name = selectRole.role_name;
            updateInfo.currentConvFlow.role_id = selectRole.role_id;
            updateInfo.convFlowList[index].role_pic = selectRole.role_picUrl;
            updateInfo.convFlowList[index].role_name = selectRole.role_name;
            updateInfo.convFlowList[index].role_id = selectRole.role_id;
            console.log("updateInfo", updateInfo);
            this.lf.setProperties(this.$data.clickNode.id, Object.assign({}, updateInfo));
            this.$data.conv_role_visible = false;
        },
        closeRolePanel() {
            this.$data.role_visible = false;
            this.$data.conv_role_visible = false;
        },
        closeLocPanel() {
            this.$data.loc_visible = false;
        },
        $_saveUserData() {
            const userdata = {
                allReward: this.allReward,
                allRole: this.allRole,
                allLocation: this.allLocation,
                graphData: JSON.stringify(this.lf.getGraphData())
            };
            this.userData = userdata;
        }
    }
};
module.exports = component;
